package no19.enum1;

import java.util.EnumSet;

enum AlarmPoints{
	STAIR1,STAIR2,STAIR3,STAIR4,STAIR5
}

public class EnumSets {
	public static void main(String[] args) {
		//创建一个具有指定元素类型的空枚举 set
		EnumSet<AlarmPoints> points = EnumSet.noneOf(AlarmPoints.class);
		points.add(AlarmPoints.STAIR2);
		System.out.println(points);
		points.addAll(EnumSet.of(AlarmPoints.STAIR3, AlarmPoints.STAIR4,AlarmPoints.STAIR5));
		System.out.println(points);
		points.removeAll(EnumSet.of(AlarmPoints.STAIR1, AlarmPoints.STAIR4,AlarmPoints.STAIR5));
		System.out.println(points);
	}
}
